
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.*;

import javax.swing.*;


// w linijce buttonCard="number"+"png"; trzeba zmienić numbera
//buttonCard="wartośćKarty"+"_"+"numerFigury"+".png";
//ale nie wiem gdzie w końcu to zbierasz

/**
 *
 * @author Asia
 */
public class ChangeCard {

    static String buttonCard;
    public static JButton jButton6=new JButton();
    public static JButton jButton7=new JButton();
    public static JButton jButton8=new JButton();
    public static JButton jButton9=new JButton();
    public static JButton jButton10=new JButton();
    public static JButton jButton11=new JButton();
    public static JButton jButton12=new JButton();
    public static JButton jButton13=new JButton();
    public static JButton jButton14=new JButton();
    public static JButton jButton15=new JButton();
    public static JButton jButton16=new JButton();
    public static JButton jButton17=new JButton();
    public static JButton jButton18=new JButton();
    public static JButton jButton19=new JButton();
    public static JButton jButton20=new JButton();
    public static JButton jButton21=new JButton();
    public static JButton jButton22=new JButton();
    public static JButton jButton23=new JButton();
    public static JButton jButton24=new JButton();
    public static JButton jButton25=new JButton();
    public static JButton jButton26=new JButton();
    public static JButton jButton27=new JButton();
    public static JButton jButton28=new JButton();
    public static JButton jButton29=new JButton();      
    
    
    public static JCheckBox jCheckBox1=new JCheckBox();
    public static JCheckBox jCheckBox2=new JCheckBox();
    public static JCheckBox jCheckBox3=new JCheckBox();
    public static JCheckBox jCheckBox4=new JCheckBox();
    public static JCheckBox jCheckBox5=new JCheckBox();
    public static JCheckBox jCheckBox6=new JCheckBox();
    public static JCheckBox jCheckBox7=new JCheckBox();
    public static JCheckBox jCheckBox8=new JCheckBox();
    public static JCheckBox jCheckBox9=new JCheckBox();
    public static JCheckBox jCheckBox10=new JCheckBox();
    public static JCheckBox jCheckBox11=new JCheckBox();
    public static JCheckBox jCheckBox12=new JCheckBox();
    public static JCheckBox jCheckBox13=new JCheckBox();
    public static JCheckBox jCheckBox14=new JCheckBox();
    public static JCheckBox jCheckBox15=new JCheckBox();
    public static JCheckBox jCheckBox16=new JCheckBox();
    public static JCheckBox jCheckBox17=new JCheckBox();
    public static JCheckBox jCheckBox18=new JCheckBox();
    public static JCheckBox jCheckBox19=new JCheckBox();
    public static JCheckBox jCheckBox20=new JCheckBox();
    public static JCheckBox jCheckBox21=new JCheckBox();
    public static JCheckBox jCheckBox22=new JCheckBox();
    public static JCheckBox jCheckBox23=new JCheckBox();
    public static JCheckBox jCheckBox24=new JCheckBox();
    
    

    
    
    public static void cardDisplay6() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton6 = new JButton(new ImageIcon(buttonIcon));
        jButton6.setBorder(BorderFactory.createEmptyBorder());
        jButton6.setContentAreaFilled(false);
    }
    
    public static void cardDisplay7() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton7 = new JButton(new ImageIcon(buttonIcon));
        jButton7.setBorder(BorderFactory.createEmptyBorder());
        jButton7.setContentAreaFilled(false);
    }
    
    public static void cardDisplay8() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton8 = new JButton(new ImageIcon(buttonIcon));
        jButton8.setBorder(BorderFactory.createEmptyBorder());
        jButton8.setContentAreaFilled(false);
    }
    public static void cardDisplay9() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton9 = new JButton(new ImageIcon(buttonIcon));
        jButton9.setBorder(BorderFactory.createEmptyBorder());
        jButton9.setContentAreaFilled(false);
    }
    public static void cardDisplay10() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton10 = new JButton(new ImageIcon(buttonIcon));
        jButton10.setBorder(BorderFactory.createEmptyBorder());
        jButton10.setContentAreaFilled(false);
    }
    public static void cardDisplay11() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton11 = new JButton(new ImageIcon(buttonIcon));
        jButton11.setBorder(BorderFactory.createEmptyBorder());
        jButton11.setContentAreaFilled(false);
    }
    public static void cardDisplay12() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton12 = new JButton(new ImageIcon(buttonIcon));
        jButton12.setBorder(BorderFactory.createEmptyBorder());
        jButton12.setContentAreaFilled(false);
    }
    public static void cardDisplay13() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton13 = new JButton(new ImageIcon(buttonIcon));
        jButton13.setBorder(BorderFactory.createEmptyBorder());
        jButton13.setContentAreaFilled(false);
    }
    public static void cardDisplay14() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton14 = new JButton(new ImageIcon(buttonIcon));
        jButton14.setBorder(BorderFactory.createEmptyBorder());
        jButton14.setContentAreaFilled(false);
    }
    public static void cardDisplay15() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton15 = new JButton(new ImageIcon(buttonIcon));
        jButton15.setBorder(BorderFactory.createEmptyBorder());
        jButton15.setContentAreaFilled(false);
    }
    public static void cardDisplay16() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton16 = new JButton(new ImageIcon(buttonIcon));
        jButton16.setBorder(BorderFactory.createEmptyBorder());
        jButton16.setContentAreaFilled(false);
    }
    public static void cardDisplay17() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton17 = new JButton(new ImageIcon(buttonIcon));
        jButton17.setBorder(BorderFactory.createEmptyBorder());
        jButton17.setContentAreaFilled(false);
    }
    public static void cardDisplay18() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton18 = new JButton(new ImageIcon(buttonIcon));
        jButton18.setBorder(BorderFactory.createEmptyBorder());
        jButton18.setContentAreaFilled(false);
    }
    public static void cardDisplay19() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton19 = new JButton(new ImageIcon(buttonIcon));
        jButton19.setBorder(BorderFactory.createEmptyBorder());
        jButton19.setContentAreaFilled(false);
    }
    public static void cardDisplay20() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton20 = new JButton(new ImageIcon(buttonIcon));
        jButton20.setBorder(BorderFactory.createEmptyBorder());
        jButton20.setContentAreaFilled(false);
    }
    public static void cardDisplay21() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton21 = new JButton(new ImageIcon(buttonIcon));
        jButton21.setBorder(BorderFactory.createEmptyBorder());
        jButton21.setContentAreaFilled(false);
    }
    public static void cardDisplay22() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton22 = new JButton(new ImageIcon(buttonIcon));
        jButton22.setBorder(BorderFactory.createEmptyBorder());
        jButton22.setContentAreaFilled(false);
    }
    public static void cardDisplay23() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton23 = new JButton(new ImageIcon(buttonIcon));
        jButton23.setBorder(BorderFactory.createEmptyBorder());
        jButton23.setContentAreaFilled(false);
    }
    public static void cardDisplay24() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton24 = new JButton(new ImageIcon(buttonIcon));
        jButton24.setBorder(BorderFactory.createEmptyBorder());
        jButton24.setContentAreaFilled(false);
    }
    public static void cardDisplay25() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton25 = new JButton(new ImageIcon(buttonIcon));
        jButton25.setBorder(BorderFactory.createEmptyBorder());
        jButton25.setContentAreaFilled(false);
    }
    
    public static void cardDisplay26() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton26 = new JButton(new ImageIcon(buttonIcon));
        jButton26.setBorder(BorderFactory.createEmptyBorder());
        jButton26.setContentAreaFilled(false);
    }
    public static void cardDisplay27() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton27 = new JButton(new ImageIcon(buttonIcon));
        jButton27.setBorder(BorderFactory.createEmptyBorder());
        jButton27.setContentAreaFilled(false);
    }
    public static void cardDisplay28() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton28 = new JButton(new ImageIcon(buttonIcon));
        jButton28.setBorder(BorderFactory.createEmptyBorder());
        jButton28.setContentAreaFilled(false);
    }
    public static void cardDisplay29() throws IOException{
        buttonCard="number"+"png";
        BufferedImage buttonIcon = ImageIO.read(new File(buttonCard));
        jButton29 = new JButton(new ImageIcon(buttonIcon));
        jButton29.setBorder(BorderFactory.createEmptyBorder());
        jButton29.setContentAreaFilled(false);
    }
    
    
    public static void ifCheckbox() throws IOException{
        if(jCheckBox1.isSelected())
        {
            cardDisplay6();
        }
        if(jCheckBox2.isSelected())
        {
            cardDisplay7();
        }
        if(jCheckBox3.isSelected())
        {
            cardDisplay8();
        }
        if(jCheckBox4.isSelected())
        {
            cardDisplay9();
        }
        if(jCheckBox5.isSelected())
        {
            cardDisplay10();
        }
        if(jCheckBox6.isSelected())
        {
            cardDisplay11();
        }
        if(jCheckBox7.isSelected())
        {
            cardDisplay12();
        }
        if(jCheckBox8.isSelected())
        {
            cardDisplay13();
        }
        if(jCheckBox9.isSelected())
        {
            cardDisplay14();
        }
        if(jCheckBox10.isSelected())
        {
            cardDisplay15();
        }
        if(jCheckBox11.isSelected())
        {
            cardDisplay16();
        }
        if(jCheckBox12.isSelected())
        {
            cardDisplay17();
        }if(jCheckBox13.isSelected())
        {
            cardDisplay18();
        }
        if(jCheckBox14.isSelected())
        {
            cardDisplay19();
        }
        if(jCheckBox15.isSelected())
        {
            cardDisplay20();
        }
        if(jCheckBox16.isSelected())
        {
            cardDisplay21();
        }
        if(jCheckBox17.isSelected())
        {
            cardDisplay22();
        }
        if(jCheckBox18.isSelected())
        {
            cardDisplay23();
        }
        if(jCheckBox19.isSelected())
        {
            cardDisplay24();
        }
        if(jCheckBox20.isSelected())
        {
            cardDisplay25();
        }
        if(jCheckBox21.isSelected())
        {
            cardDisplay26();
        }
        if(jCheckBox22.isSelected())
        {
            cardDisplay27();
        }
        if(jCheckBox23.isSelected())
        {
            cardDisplay28();
        }
        if(jCheckBox24.isSelected())
        {
            cardDisplay29();
        }
        
    }
    
    
}

